//
//  CustomButton.m
//  benefits
//
//  Created by Abel Miranda on 8/8/13.
//  Copyright (c) 2013 Félix Emanuel Petitón. All rights reserved.
//

#import "CustomButton.h"

@implementation CustomButton

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initialize];
    }
    return self;
}

-(id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self initialize];
    }
    return self;
    
}

-(void)initialize
{
    self.titleLabel.font = [UIFont boldSystemFontOfSize:15];
    [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
    UIImage *background = [[UIImage imageNamed:@"img_btn_default"] resizableImageWithCapInsets:UIEdgeInsetsFromString(@"{6,6,6,6}")];
    [self setBackgroundImage:background forState:UIControlStateNormal];
    background = [[UIImage imageNamed:@"img_btn_default_over"] resizableImageWithCapInsets:UIEdgeInsetsFromString(@"{6,6,6,6}")];
    [self setBackgroundImage:background forState:UIControlStateHighlighted];
}

@end
